<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <title>中医体质分类与判定自测表（中华中医药学会标准）</title>
    <style>
    #title{
    font-size: 30px;
    text-align: center;
    font-weight: bold;
    color:#699ad9;
    }
    #parts{
        font-size: 20px;
        position:relative;
	    left:300px;
    }
    #qs{
        position:relative;
	    left:300px;
    }

    
    </style>
    </head>

    <body>
        <div id="title" >
            中医体质分类与判定自测表（中华中医药学会标准）
        </div>
        <form action="getresult.php" method="post" name="question">
        <?php
        $qn = 0;
        $questions = file_get_contents("questions.json");
        $questionarray = json_decode($questions,true);
        echo "<br />" . "<br />". "<br />";
        for($i = 0; $i < count($questionarray); $i++)
        {
            echo '<div id="parts">' . $questionarray[$i]["part"] . '</div>';
            for($j = 0; $j < count($questionarray[$i]["questions"]);$j++)
            {
                echo '<div id="qs">' . $questionarray[$i]["questions"][$j] . '</div>';
                if($qn==61 ||$qn==62 ||$qn==63 ||$qn==60 ||$qn==65 ||$qn==66)
                {echo ' <div id="qs">' . "<input type=\"radio\" name=\"q$qn\" value=\"5\">没有&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type=\"radio\" name=\"q$qn\" value=\"4\">很少&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type=\"radio\" name=\"q$qn\" value=\"3\">有时&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type=\"radio\" name=\"q$qn\" value=\"2\">经常&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type=\"radio\" name=\"q$qn\" value=\"1\">总是&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp ". '</div> ';}
                else
                {echo ' <div id="qs">' . "<input type=\"radio\" name=\"q$qn\" value=\"1\">没有&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type=\"radio\" name=\"q$qn\" value=\"2\">很少&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type=\"radio\" name=\"q$qn\" value=\"3\">有时&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type=\"radio\" name=\"q$qn\" value=\"4\">经常&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type=\"radio\" name=\"q$qn\" value=\"5\">总是&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp ". '</div> ';}
                $qn++;
            }
            echo "<br />";
            echo "<br />";
        }
        ?>
            
            <div id="qs">请输入您的姓名：<input type="text" name="question" value=""></div>
            <div id="qs"><input type="submit" value="提交"></div>
            
        </form>
          
    </body>
</html>